﻿#pragma once
#ifdef __cplusplus
extern "C" {
#endif

typedef struct bspool {
	int* handles;
	int count;
	int alloc;
	int capacity;
}bspool_t;


int bsp_init(bspool_t* bspool);
int bsp_deinit(bspool_t* bspool);

bspool_t* bsp_new_pool();
void bsp_free_pool(bspool_t* pool);

int bsp_connect(bspool_t* bspool,const char *host, int port);
int bsp_connect_with_timeout(bspool_t* bspool,const char *host, int port, float secs);
int bsp_close(bspool_t* bspool,int fd);

#ifdef __cplusplus
}
#endif
